// import { testOrderSearchEfficiency } from "hy-algokit";

import sequentSearch from "./01_查找算法-顺序查找";
import binarySearch from "./02_查找方法-二分查找";

const MAX_LENGTH = 10000000;
const nums = new Array(MAX_LENGTH).fill(0).map((_,index)=>index)
const num = MAX_LENGTH/2;

const startTime = new Date().getTime();
// const index = sequentSearch(nums,num)
const index = binarySearch(nums,num)
const endTime = new Date().getTime();
console.log('索引的位置',index,'消耗的时间:',(endTime - startTime))


// testOrderSearchEfficiency(sequentSearch)
// testOrderSearchEfficiency(binarySearch)

//更加精确的获取时间的方法：会报错
// console.log(performance.now())

export {}
